#from wfcommon.units import unit_roll
#def unitstr(m,u)
#if $getVar('http', False)
<a href="-set-?s=units&k=$m&v=$unit_roll($m,$u)">$u</a>
#else
$u
#end if
#end def
<html>
<head>
    <title>Weather Dashboard - wfrog $version</title>
    <style>
        body {
            font-family: helvetica;
            font-size: 13px;
            color: #8D7641;
        }
        a {
            color: #8D7641;
        }
            A:link {text-decoration: none}
            A:visited {text-decoration: none}
            A:active {text-decoration: none}
            A:hover {text-decoration: underline;}
        .value {
            color: #007000;
        }
        .bordered {
            border: 1px solid tan;
        }
        .cell {
            margin: 3px;
            padding: 6px;
            float: left;
        }
        .headerNoPad {
            margin: 3px;
            padding-left: 6px;
            padding-right: 6px;            
            float: left;
        }
        .pad {
            padding: 6px;
            padding-top: 10px;
            padding-bottom: 2px;
        }
        .smallpad {
            padding: 4px;
            padding-bottom: 2px;
        }
        .line {
            padding-top: 3px;
            padding-bottom: 3px;
        }
        .header {
            margin: 3px;
            padding-left: 6px;
            padding-right: 6px;
            padding-top: 10px;    
            padding-bottom: 2px;                 
            float: left;            
        }
        .headerContent {
            height: 64px;            
        }
        .wide {
            width: 95%;
        }
        .leftCell {
            float: left;
        }
        .rightAlign {
            text-align: right;
        }
        .rightCell {
            position: relative;
            right: 0px;
            text-align: right;
        }
        .leftpad {
            padding-left: 5;
        }
        .bigger {
            font-size: 140%;
        }
        .tabPane {
            width: 95%;
            margin: 3px;
            padding-top: 3px;
            padding-bottom: 0px;
            clear: both;
            height: 21px;
            border-bottom: 1px solid tan;
        }
        .tab {
            margin-bottom:3px;
            margin-left: 3px;
            margin-right: 3px;
            padding-left: 6px;
            padding-right: 6px;
            padding-top: 2px;
            padding-bottom: 2px;
            float: left;
            height: 16px;
            background: wheat;
            border-bottom: 1px solid wheat;
        }
        .selected {
            background: white;
            border-right: 1px solid tan;
            border-top: 1px solid tan;
            border-left: 1px solid tan;
            border-bottom: 1px solid white;
        }
        .symbol {
            font-size:120%;
        }
        .graph {
            line-height:18px;
        }
        .units {
            position: relative;
            right: 0px;
            text-align: right;
        }
    </style>
</head>
<body>

<div class="wide bordered line cell">
            <div class="leftCell">wfrog $version - Weather Dashboard </div><div class="rightCell">&#8986; <span class="value">$current.timestamp</span></div>
</div>

<div class="bordered header">
    <div class="headerContent">
        <a href="http://www.wfrog.org"><img border="0" src="http://code.google.com/p/wfrog/logo" alt="wfrog"/></a>
    </div>
</div>
<div class="bordered header">
    <div class="headerContent">
        <div class="leftCell">
            <span class="symbol">&#9832;</span> <span class="bigger" ><span class="value">$rnd($current.temp1, 1)</span>&deg;</span>$unitstr('temp',$units.temp)<br>
            Humidity <span class="value">$rnd($current.hum1)</span> % <br>
            Pressure <span class="value">$rnd($current.press)</span> $unitstr('press',$units.press)
        </div>
        <div class="leftCell leftpad rightAlign">
            <span class="bigger">&#8962; &nbsp;</span><br>
            <span class="value">$rnd($current.temp0,1)</span>&deg;$unitstr('temp',$units.temp) <br>
            <span class="value">$rnd($current.hum0)</span> %
        </div>
    </div>
</div>
<div class="bordered headerNoPad">
    <div class="leftCell">
        <img src="$current.wind.dir"/>
    </div>
    <div class="leftCell smallpad">
        <br style="font-size:50%">Wind <span class="value">$rnd($current.wind.speed, 1)</span> $unitstr('wind',$units.wind)<br>
        Gust <span class="value">$rnd($current.wind.gust, 1)</span> $unitstr('wind',$units.wind)<br>
        Rain <span class="value">$rnd($current.rain, 1)</span> $unitstr('rain',$units.rain)/h<br>
        <!-- UV Index <span class="value">0</span> -->
    </div>
</div>
<div class="tabPane">
    <div class="leftCell" style="width:10px;">&nbsp;</div>
    <div id="3hours" class="tab"><a href="3hours.html">3 Hours</a></div>    
    <div id="24hours" class="tab"><a href="24hours.html">24 Hours</a></div>
    <div id="30days" class="tab"><a href="30days.html">30 Days</a></div>
    <div id="365days" class="tab"><a href="365days.html">365 Days</a></div>
</div>
<div>
    <div class="bordered cell graph">
        <div class="leftCell"><span class="symbol">&#9832;</span> Temperature and Dew Point</div><div class="units">&deg;$unitstr('temp',$units.temp)</div>
        <div><img src="$chart.temp"/></div>
    </div>
    <div class="bordered cell graph">
        <div class="leftCell"><span class="symbol">&#8776;</span> Humidity</div><div class="units">%</div>
        <div><img src="$chart.hum"/></div>
    </div>
    <div class="bordered cell graph">
       <div class="leftCell"> <span class="symbol">&#9839;</span> Pressure</div><div class="units">$unitstr('press',$units.press)</div>
        <div><img src="$chart.press"/></div>
    </div>
</div>
<div class="leftCell">
    <div class="bordered cell graph"  style="clear: both">
        <div class="leftCell"><span class="symbol">&#8885;</span> Wind and Gusts</div><div class="units">$unitstr('wind',$units.wind)</div>
        <div><img src="$chart.wind"/></div>
    </div>
    <div class="bordered cell graph">
        <div class="leftCell"><span class="symbol">&#10037;</span> Wind Direction</div>
        <div><img src="$chart.wind_dir"/></div>
    </div>
</div>
<div class="leftCell">
    <div class="bordered cell graph"  style="clear: both">
        <div class="leftCell"><span class="symbol">&#9730;</span> Rain</div><div class="units">$unitstr('rain',$units.rain)</div>
        <div><img src="$chart.rain"/></div>
    </div>
    <div class="bordered cell graph">
        <div class="leftCell"><span class="symbol">&#9728;</span> UV Index</div>
        <div><img src="$chart.uv"/></div>
    </div>
</div>
</body>

<script>
// Highlight the correct tab according to the url
if(window.location.href.indexOf("30days.html") > -1) {
    document.getElementById("30days").className += ' selected';
} else if(window.location.href.indexOf("365days.html") > -1) {
    document.getElementById("365days").className += ' selected';
} else if(window.location.href.indexOf("3hours.html") > -1) {
    document.getElementById("3hours").className += ' selected';
} else {
    document.getElementById("24hours").className += ' selected';
}
</script>
</html>
